]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overview: Only accept AppIcon drops if the app can open a new window
authorJonas Dreßler <verdre@v0yd.nl>
Thu, 2 May 2019 15:04:03 +0000 (17:04 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 18 Sep 2019 17:14:16 +0000 (17:14 +0000)
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/121

js/ui/workspace.js
js/ui/workspaceThumbnail.js

index 39b59f9d587a13eaa8c903d01c9f4d56d269106a..7ffec352b8526d430fa6e1be7806959042765344 100644 (file)
@@ -1994,7 +1994,7 @@ var Workspace = class {
     handleDragOver(source, _actor, _x, _y, _time) {
         if (source.realWindow && !this._isMyWindow(source.realWindow))
             return DND.DragMotionResult.MOVE_DROP;
-        if (source.app)
+        if (source.app && source.app.can_open_new_window())
             return DND.DragMotionResult.COPY_DROP;
         if (!source.app && source.shellWorkspaceLaunch)
             return DND.DragMotionResult.COPY_DROP;
@@ -2031,7 +2031,7 @@ var Workspace = class {
 
             metaWindow.change_workspace_by_index(workspaceIndex, false);
             return true;
-        } else if (source.app) {
+        } else if (source.app && source.app.can_open_new_window()) {
             source.app.open_new_window(workspaceIndex);
             return true;
         } else if (!source.app && source.shellWorkspaceLaunch) {
index e3a24e9d4f72015e909be95e9be810163ac024e8..91286e2b3561cc35adde85f3964845fc0fec01e0 100644 (file)
@@ -572,7 +572,7 @@ var WorkspaceThumbnail = GObject.registerClass({
 
         if (source.realWindow && !this._isMyWindow(source.realWindow))
             return DND.DragMotionResult.MOVE_DROP;
-        if (source.app)
+        if (source.app && source.app.can_open_new_window())
             return DND.DragMotionResult.COPY_DROP;
         if (!source.app && source.shellWorkspaceLaunch)
             return DND.DragMotionResult.COPY_DROP;
@@ -599,7 +599,7 @@ var WorkspaceThumbnail = GObject.registerClass({
 
             metaWindow.change_workspace_by_index(this.metaWorkspace.index(), false);
             return true;
-        } else if (source.app) {
+        } else if (source.app && source.app.can_open_new_window()) {
             source.app.open_new_window(this.metaWorkspace.index());
             return true;
         } else if (!source.app && source.shellWorkspaceLaunch) {
@@ -787,7 +787,7 @@ var ThumbnailsBox = GObject.registerClass({
     // Draggable target interface
     handleDragOver(source, actor, x, y, time) {
         if (!source.realWindow &&
-            !source.app &&
+            (!source.app || !source.app.can_open_new_window()) &&
             (source.app || !source.shellWorkspaceLaunch) &&
             source != Main.xdndHandler)
             return DND.DragMotionResult.CONTINUE;
@@ -847,7 +847,7 @@ var ThumbnailsBox = GObject.registerClass({
             return this._thumbnails[this._dropWorkspace].acceptDropInternal(source, time);
         } else if (this._dropPlaceholderPos != -1) {
             if (!source.realWindow &&
-                !source.app &&
+                (!source.app || !source.app.can_open_new_window()) &&
                 (source.app || !source.shellWorkspaceLaunch))
                 return false;
 
@@ -865,7 +865,7 @@ var ThumbnailsBox = GObject.registerClass({
                 if (source.metaWindow.get_monitor() != thumbMonitor)
                     source.metaWindow.move_to_monitor(thumbMonitor);
                 source.metaWindow.change_workspace_by_index(newWorkspaceIndex, true);
-            } else if (source.app) {
+            } else if (source.app && source.app.can_open_new_window()) {
                 source.app.open_new_window(newWorkspaceIndex);
             } else if (!source.app && source.shellWorkspaceLaunch) {
                 // While unused in our own drag sources, shellWorkspaceLaunch allows